package com.example.test.advice.第三章_类_对象_方法.建议39_使用匿名类的构造函数;

import java.util.ArrayList;
import java.util.List;

public class AnonymityClass {

    public static void main(String[] args) {
        List l1 = new ArrayList<>();
        List l2 = new ArrayList(){};
        List l3 = new ArrayList(){
            {}//代表构造函数
        };
        System.out.println("l1==l2:"+(l1.getClass()==l2.getClass()));
        System.out.println("l2==l3:"+(l2.getClass()==l3.getClass()));
        System.out.println("l1==l3:"+(l1.getClass()==l3.getClass()));
    }
}
